fix: Fixed the message given to the player when using the light switch. #5795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Purpose of change
When using the light switch the
iexamine::toggle_lights
was giving the wrong message to the player ("You switched off the lights." when turning them on and viceversa), turn out it was because the function was changing the state of the switch before retrieving it's message.Describe the solution
Simply moving the line displaying the message to before changing the furnitures.
Describe alternatives you've considered
Retrieving and storing the message in a variable so the message still get executed in the end of the function, however this is kinda going back on a scarf review in #5626 (comment)_